package com.bw.z.mvp.view.activity;

import android.graphics.Color;
import android.view.View;

import com.bw.z.R;
import com.bw.z.handler.TimerHandler;
import com.bw.z.mvp.contract.SplashContract;
import com.bw.z.mvp.di.DaggerSplashComponent;
import com.bw.z.mvp.di.SplashModules;
import com.bw.z.mvp.model.SplashModel;
import com.bw.z.mvp.presenter.SplashPresenter;
import com.bw.z.mvp.base.view.BaseActivity;
import com.bw.z.thread.TimerThread;

public class SplashActivity extends BaseActivity<SplashPresenter>
        implements SplashContract.ISplashView, TimerHandler.TimerCallBack {
    @Override
    public View addStatusView() {
        return f(R.id.splash_linear);
    }

    @Override
    public void refresh() {
        new TimerThread(new TimerHandler(this)).start();
    }

    @Override
    public int bindLayout() {
        return R.layout.activity_splash;
    }

    @Override
    public void initView() {
        getColors(Color.WHITE);
    }

    @Override
    public void inject() {
        DaggerSplashComponent.builder().splashModules(new SplashModules(this)).build().injectSplash(this);
    }

    @Override
    public void initData() {
        p.requestToken();
    }


    @Override
    public void callBack() {
        startPage(MainActivity.class);
        finish();
    }
}
